#!/usr/bin/env python
import json
import sys
import constant



class NodeList(object):
    """
    Node list of a user's followers or fans with the same opeartion.
    Operation type here includes "addattention" "delstars" "delfans".
    These operations will be implemented in (Reduce.)

    Node list is the output of (Map), and the input of (Reduce).

    Attributes:
        list: list of users' ids.
        type: type of operations.
    """
    list = None
    type = None
    op_time = None

    def __init__(self, array, tp, time):
        self.list = array
        self.type = tp
        self.op_time = time

    def __init__(self, line):
        str_split = line.split(":")
        self.list = eval(str_split[0]);
        self.type = str_split[1];
        self.op_time = int(str_split[2]);

    def __str__(self):
        return '%s:%s:%d' % (self.list, self.type, self.op_time)

    

